[?php

/**
 * Project filter form base class.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage filter
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfPropelFormFilterBaseTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
abstract class BaseFormFilterPropel extends sfFormFilterPropel
{
  public function setup()
  {
    $this->setWidget('_search_done',new sfWidgetFormInputHidden());
    $this->setDefault('_search_done',1);
    $this->setValidator('_search_done', new sfValidatorBoolean());
  }

  /**
   * Unsets all fields except the fields in the parameter $fields
   *
   * @param Array $fields The fields that should NOT be unset
   */
  protected function unsetAllExcept($fields = array())
  {
    $fields = array_merge($fields, $this->getNonUnsettableFieldsArray());

    foreach (array_diff(array_keys($this->widgetSchema->getFields()), $fields) as $value)
    {
      unset($this[$value]);
    }
  }


  protected function getNonUnsettableFieldsArray()
  {
    return array('_csrf_token','_search_done');
  }

  public function unsetFields()
  {
  }

}
